<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="spring" 	uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="tiles" 	uri="http://tiles.apache.org/tags-tiles" %>
<%@ taglib prefix="c"		uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html; charset=utf-8" %>
<%@ page language="java" pageEncoding="utf-8"%>

<script type="text/javascript">
$(document).ready(function(){
	setMenuSelection("adauga");
	
    $("#btPartenerList").kendoButton({icon: "funnel"});

    $("#btPartenerCard").kendoButton({icon: "plus"});
	
    $("#btApplyFilter").kendoButton({icon: "tick"});

    $("#btResetFilter").kendoButton({icon: "cancel"});
    
    
    $("#gridPartenerList").kendoGrid({
    	dataSource : {
            type     : "json",
            transport: {
                read: "json/listRefBank"
            },
            schema   : {
                data: "rows"
            }
        },
        columns: [
				{
					field:"id",  							
					title: "#",
					width: 40,
					hidden: true
				},
          		{	
					field:"mdValue",  						
					title: "Denumirea Ro",
					sortable: true,
					width: 100,
					template: renderMdValue
				},
                {field: "status", 						title: "Statut",	width: 40}
          ],
          height: 500,
          groupable: true,
          sortable: true,
          refresh: true, 
          pageable: {
        	  pageSize: 10,
        	  pageSizes: [10,15,20]
          }

    });    
 
	function  renderMdValue (dataItem, b, c) {
		return "<a href='adaugaPartener?pId="+dataItem.id + "'>" + kendo.htmlEncode(dataItem.mdValue) + "</a>"; 
	};    
    

});

function btApplyClick(){
	$("#gridPartenerList").data("kendoGrid").dataSource.read();
	$("#gridPartenerList").data("kendoGrid").refresh();
};

function btResetClick(){
	
};

</script>
<CENTER>
<p style="text-align: left;">
	<button id="btPartenerList" type="button" onclick="javascript:window.open('vizualizeazaPartener', 	target='_self')";>Lista parteneri</button>
	<button id="btPartenerCard" type="button"  onclick="javascript:window.open('adaugaPartener', 		target='_self')";>Adaugă partener</button>
	<c:if test="${errorMessage != '' &&  errorMessage != '0'}">
		<span id="errorMessage" class="errorMessage"> ${errorMessage} </span>
	</c:if>
</p>
<div id="tabPartenerListFilters" style="text-align: left; font-size: 12px;" class="k-block k-shadow" ><div class="k-header">Parametrii de cautare</div>
	<table style="width: 100%; border: 1px;" border="0" >
			<tr>
				<td style="width: 100px;">IDNP</td>
				<td style="width: 200px;">Prenume</td>
				<td style="width: 200px;">Nume</td>
				<td>						Compania</td>
			</tr>
			<tr>
				<td><input id='fIdnp' 			name='fIdnp' 		type='text' value='' class="k-textbox" style="width: 100px;"></td>
				<td><input id='fPrenume' 		name='fPrenume' 	type='text' value='' class="k-textbox" style="width: 200px;"></td>
				<td><input id='fNume' 			name='fNume' 		type='text' value='' class="k-textbox" style="width: 200px;"></td>
				<td><input id='fOrganizatie' 	name='fOrganizatie'	type='text' value='' class="k-textbox" style="width: 300px;"></td>
			</tr>
		</table>
		<p style="text-align: right;">
				<button id="btApplyFilter" type="button"	onclick="btApplyClick()" >Aplica</button>
				<button id="btResetFilter" type="button" 	onclick="btResetClick()" >Curata</button>			
		</p>		
</div>
<div id="gridPartenerList"></div>

</center>




